class Solution(object):
    def breakPalindrome(self, palindrome):
        if len(palindrome) == 1:
            return ''
        n = len(palindrome)
        for i in range(n):
            if palindrome[i] != 'a':
                if palindrome[:i] == palindrome[n - 1: i: -1]:
                    continue
                else:
                    return palindrome[:i] + 'a' + palindrome[i + 1:]
        return palindrome[:-1] + 'b'
